<?php
class App_Module_Admin_Tpl_Icon extends Mozg_Templator
{
	public function GetIcon($type, $url = false, $title = '', array $attr = array())
	{
		$this->url = $url;
		$this->title = $title;
		
		$this->attr = '';
		foreach ($attr as $attrKey => $attrVal)
		{
			$this->attr .= $attrKey. '="' .htmlspecialchars($attrVal). '" ';
		}
		
		$this->attr = trim($this->attr);
		
		if (is_numeric($type)) $type = 'empty';
		
		return $this->render('icons/_icon_' .$type. '.phtml');
	}
	
	public function GetIconSet(array $iconParams = array(), $type = false)
	{
		if (false === $type) $type = 'default';
		
		$this->iconParams = $iconParams;
		return $this->render('icons/_iconset_' .$type. '.phtml');
	}
}